package com.itheima.dubbo.impl;

import com.itheima.dubbo.UserFace;
import com.itheima.dubbo.pojo.Student;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * timeout  设置超时时间
 * version  设置版本
 * retries  设置重试次数
 * loadbalance 设置负载均衡机制
 */
@DubboService(timeout = 3000,version = "1.0.0",retries = 0,loadbalance = "random")
public class UserFaceImpl implements UserFace {
    /**
     * 测试方法
     * @param username 用户名
     * @return
     */
    @Override
    public String hello(String username) {
        return "hello Dubbo"+username;
    }

    /**
     * 根据学生id查找学生信息
     * @param student
     * @return
     */
    @Override
    public Student findById(Student student) {

        student.setId(student.getId());
        student.setName(student.getName());
        student.setAge(student.getAge());
        return student;
    }
}
